<?php
/**
 # mod_jv_facelinker - JV FaceLinker
 # @version        3.0.1 
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2012 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/

// No direct access
defined('_JEXEC') or die('Restricted access');
JHTML::_( 'behavior.framework' );                                         

$randid  = 'jv_'.rand(100,500);

$script1 = "
            window.addEvent( 'domready' ,  function() {
                //--horizontal
                var mySlide = new Fx.Slide('test_$randid'$likebox->slide).hide(); //, {mode: 'horizontal'}
                $('slide_$randid').addEvent('mouseenter', function(e){
                    e = new Event(e);
                    mySlide.toggle();
                    e.stop();        
                });
                
                $('slide_$randid').addEvent('mouseleave', function(e){
                    e = new Event(e);
                    mySlide.toggle();
                    e.stop();        
                });                                
                
            });
            
";

$script2 = "
            window.addEvent( 'domready' ,  function() {                             
                var mySlide2 = new Fx.Slide('test2_$randid'$livestream->slide).hide(); //, {mode: 'horizontal'}
                $('slide2_$randid').addEvent('mouseenter', function(e){
                    e = new Event(e);
                    mySlide2.toggle();
                    e.stop();        
                });
                
                $('slide2_$randid').addEvent('mouseleave', function(e){
                    e = new Event(e);
                    mySlide2.toggle();
                    e.stop();        
                });
                
            });
";
 
?>

    <?php
    if($likebox->showlikebox){
        if(!$likebox->url){ ?>
            <div>Your URL is empty</div> 
    <?php }else {                                                                             
        if($likebox->noneSlide == false){
            $document->addScriptDeclaration($script1);    
        }
        if($likebox->position == 'default'){?>
    <div> 
    <?php }else{?>
    <div class="jv-likebox slide_<?php echo $likebox->position?>" id="slide_<?php echo $randid ?>" style="position: fixed;">             
    <?php }?>                                                                                      
                 <a id="toggle_<?php echo $randid ?>" target="_blank" href="<?php echo $likebox->iconLink?>" class="title<?php echo $likebox->icon?>"></a>
                 <div id="test_<?php echo $randid ?>" class="likeboxframe<?php echo $likebox->border?> likebox<?php echo $params->get('moduleclass_sfx');?>">
                 <iframe class="iframelike" src="http://www.facebook.com/plugins/likebox.php?href=<?php echo $likebox->url;?>&amp;width=<?php echo $likebox->width;?>&amp;connections=<?php echo $likebox->fans;?>&amp;stream=<?php echo $likebox->stream;?>&amp;header=<?php echo $likebox->header;?>&amp;height=<?php echo $likebox->height;?>" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:<?php echo $likebox->width;?>px; height:<?php echo $likebox->height;?>px;" allowTransparency="true"></iframe>
                 </div>
                 
    </div> 
       
    
    <?php }}       
    if($livestream->showlivestream){
        if(!$livestream->app_id){ ?>
            <div>Your APP ID is empty</div> 
    <?php }else { 
        if($livestream->noneSlide == false){
            $document->addScriptDeclaration($script2);    
        }
        if($livestream->position == 'default'){?>
    <div> 
    <?php }else{?>
    <div class="jv-livestream slide_<?php echo $livestream->position?>" id="slide2_<?php echo $randid ?>" style="position: fixed;">
    <?php }?> 
                 <a id="toggle2_<?php echo $randid ?>" target="_blank" href="<?php echo $livestream->iconLink?>" class="title<?php echo $livestream->icon?>"></a> 
                 <div id="test2_<?php echo $randid ?>" class="livestreamframe<?php echo $livestream->border?> livestream<?php echo $params->get('moduleclass_sfx');?>">                 
                 <iframe class="iframestream" src="http://www.facebook.com/plugins/livefeed.php?always_post_to_friends=<?php echo $livestream->postfriend;?>&api_key=<?php echo $livestream->app_id;?>&height=<?php echo $livestream->height;?>&width=<?php echo $livestream->width;?>&xid=<?php echo $livestream->x_id;?>" scrolling="no" frameborder="0" style="border-bottom:1px solid #D7DAE1; overflow:hidden; width:<?php echo $livestream->width;?>px; height:<?php echo $livestream->height;?>px;" allowTransparency="true"></iframe>
                 </div>
                 <!--APP ID to test: 8331309681-->    
    </div>         
    <?php }
    }?>

 
    

